package model

import (
	"gorm.io/gorm"
)

type ChatHistory struct {
	Id         uint           `gorm:"column:id;type:bigint(20) UNSIGNED;primaryKey;not null;" json:"id"`
	FormUserId uint           `gorm:"column:form_user_id;type:bigint(20) UNSIGNED;not null;" json:"form_user_id"`
	ToUserId   uint           `gorm:"column:to_user_id;type:bigint(20) UNSIGNED;not null;" json:"to_user_id"`
	RoomId     uint           `gorm:"column:room_id;type:bigint(20) UNSIGNED;not null;" json:"room_id"`
	Content    string         `gorm:"column:content;type:varchar(50);not null;" json:"content"`
	CType      uint           `gorm:"column:c_type;type:int(10);comment:类型: 1-文本 2-视频 3-文件;not null;" json:"c_type"` // 类型: 1-文本 2-视频 3-文件
	CreatedAt  gorm.DeletedAt `gorm:"column:created_at;type:datetime(3);not null;default:CURRENT_TIMESTAMP(3);" json:"created_at"`
}

func (c *ChatHistory) TableName() string {
	return "chat_history"
}
